On Algorithms and Complexity for Sets with Cardinality Constraints PSPACE and PTIME Logics for Program Analysis

نویسندگان

  • Bruno Marnette
  • Viktor Kuncak
  • Martin Rinard
چکیده

Typestate systems ensure many desirable properties of imperative programs, including initialization of object fields and correct use of stateful library interfaces. Abstract sets with cardinality constraints naturally generalize typestate properties: relationships between the typestates of objects can be expressed as subset and disjointness relations on sets, and elements of sets can be represented as sets of cardinality one. In addition, sets with cardinality constraints provide a natural language for specifying operations and invariants of data structures. Motivated by these program analysis applications, this paper presents new algorithms and new complexity results for constraints on sets and their cardinalities. We study several classes of constraints and demonstrate a trade-off between their expressive power and their complexity. Our first result concerns a quantifier-free fragment of Boolean Algebra with Presburger Arithmetic. We give a nondeterministic polynomial-time algorithm for reducing the satisfiability of sets with symbolic cardinalities to constraints on constant cardinalities, and give a polynomial-space algorithm for the resulting problem. The best previously existing algorithm runs in exponential space and nondeterministic exponential time. In a quest for more efficient fragments, we identify several subclasses of sets with cardinality constraints whose satisfiability is NP-hard. Finally, we identify a class of constraints that has polynomial-time satisfiability and entailment problems and can serve as a foundation for efficient program analysis. We give a system of rewriting rules for enforcing certain consistency properties of these constraints and show how to extract complete information from constraints in normal form. This result implies the soundness and completeness of our algorithms.

منابع مشابه

Polynomial Constraints for Sets with Cardinality Bounds

Logics that can reason about sets and their cardinality bounds are useful in program analysis, program verification, databases, and knowledge bases. This paper presents a class of constraints on sets and their cardinalities for which the satisfiability and the entailment problems are computable in polynomial time. Our class of constraints, based on tree-shaped formulas, is unique in being simul...

متن کامل

On Algorithms and Complexity for Sets with Cardinality Constraints

Typestate systems ensure many desirable properties of imperative programs, including initialization of object fields and correct use of stateful library interfaces. Abstract sets with cardinality constraints naturally generalize typestate properties: relationships between the typestates of objects can be expressed as subset and disjointness relations on sets, and elements of sets can be represe...

متن کامل

When Do Fixed Point Logics Capture Complexity Classes?

We give examples of classes of rigid structures which are of unbounded rigidity but Least xed point (Partial xed point) logic can express all Boolean PTIME (PSPACE) queries on these classes. This shows that deenability of linear order in FO+LFP although suucient for it to capture Boolean PTIME queries, is not necessary even on the classes of rigid structures. The situation however appears very ...

متن کامل

Solitaire Games ∗

The model-checking games associated with fixed-point logics are parity games, and it is currently not known whether the strategy problem for parity games can be solved in polynomial time. We study Solitaire-LFP, a fragment of least fixedpoint logic, whose evaluation games are nested soltaire games. This means that on each strongly connected component of the game, only one player can make nontri...

متن کامل

Efficient TBox Subsumption Checking in Combinations of EL and (fragments of) FL0

We study possibilities of combining (fragments) of the lightweight description logics FL0 and EL, and identify classes of subsumption problems in a combination of EL and Horn-FL0, which can be checked in PSPACE resp. PTIME. Since FL0 allows universal role restrictions and EL allows existential role restrictions, we thus have a framework where subsumption between expressions including both types...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

متن کامل
عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2005